package ws.performancetest.tests.jdbcdriver.runnable.delay.column;

import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;
import ws.performancetest.tests.jdbcdriver.runnable.ResultSetRunnable;

/**
 *
 * @author Wilson Santos, <wilson.santos@ua.pt>
 */
public class InsertRunnable extends ResultSetRunnable {

  @Override
  public void run() {
    try {
      initUpdateValues();

      for (int i = 0; i < linesPerThread; ++i) {
        rs.moveToInsertRow();
        rs.updateString(2, val2);
        rs.updateString(3, val3);
        rs.updateDate(4, val4);
        rs.updateDouble(5, val5);
        rs.updateInt(6, val6);
        rs.updateDate(7, val7);
        rs.updateString(8, val8);
        rs.insertRow();
        rs.moveToCurrentRow();
      }
    } catch (SQLException ex) {
      Logger.getLogger(InsertRunnable.class.getName()).log(Level.SEVERE, null, ex);
    }
  }
}
